package org.tio.sitexxx.im.client.handler;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tio.core.ChannelContext;
import org.tio.sitexxx.im.common.Command;
import org.tio.sitexxx.im.common.CommandHandler;
import org.tio.sitexxx.im.common.ImPacket;
import org.tio.sitexxx.im.common.bs.MsgTipNtf;
import org.tio.utils.json.Json;

/**
 * @author tanyaowu
 * 2016年5月9日 上午11:46:24
 */
@CommandHandler(Command.MSG_TIP)
public class MsgTipNtfHandler implements ImClientHandler {
	private static Logger log = LoggerFactory.getLogger(MsgTipNtfHandler.class);

	public MsgTipNtfHandler() {

	}

	@Override
	public void handler(ImPacket packet, ChannelContext channelContext) throws Exception {
		System.out.println(packet.getBodyStr());
		MsgTipNtf msgTipNtf = Json.toBean(packet.getBodyStr(), MsgTipNtf.class);
		log.error("收到提示消息：" + msgTipNtf.getMsg());
	}

}
